package ch6;

import java.util.Scanner;

public class Erwei {

	public static void main(String[] args) {
		// int[][] a = new int[5][];
		// a[0]=new int[10];
		int[][] a2 = new int[3][5];
		a2[0][0] = 199;
		a2[2][4] = 99;

		int[][] a3 = { { 1, 2 }, { 3, 5 }, { 7, 8 } };

		int[][] a4 = { { 1, 2, 3, 5 }, { 3, 5, 4 }, { 7, 8 } };
		int[][] a5 = new int[][] { { 1, 2, 3, 5 }, { 3, 5, 4 }, { 7, 8 } };

		int a6[][] = new int[5][5];
		Scanner in = new Scanner(System.in);
		for (int i = 0; i < a6.length; i++) {
			for (int j = 0; j < a6[i].length; j++) {
				System.out.println("请输入" + (i + 1) + "班 第" + (j + 1) + "名同学的成绩：");
				a6[i][j] = in.nextInt();
			}
		}
		int total = 0;
		for (int i = 0; i < a6.length; i++) {
			total = 0;// !!!!!
			for (int j = 0; j < a6[i].length; j++) {
				total += a6[i][j];
			}
			System.out.println((i + 1) + "班总分是：" + total);
		}
	}

}
